home *** CD-ROM | disk | FTP | other *** search
/ The Canadian & World Encyclopedia 1998 / The Canadian & World Encyclopedia 1998 - Disc 2.iso / mac / prime_CD / pb / basecast.cst / 00008_Script_profiles print btn - kf < prev    next >
Text File  |  1997-07-24  |  9KB  |  167 lines

  1. on mousedown -- profiles print btn by kf 11/29/96
  2.   set the loch of sprite the clickon to the loch of sprite the clickon + 1
  3.   set the locv of sprite the clickon to the locv of sprite the clickon + 1
  4.   updatestage
  5.   set the loch of sprite the clickon to the loch of sprite the clickon - 1
  6.   set the locv of sprite the clickon to the locv of sprite the clickon - 1
  7.   set the cursor of sprite the clickon to 4
  8.   if the controlDown = TRUE then set enablePrintPictures = TRUE
  9.   else set enablePrintPictures = FALSE
  10.   
  11.   --  set backframe to the frame
  12.   --  if the colordepth > 8 then puppettransition 51, 02, 16
  13.   --  if the machinetype < 256 then 
  14.   --    go to "printmac"
  15.   --  else 
  16.   --    go to "printwin"
  17.   --  end if
  18.   global demo, current_pm
  19.   --  if clickbutton() then
  20.   if demo then
  21.     alert "Printing is not available in this version."
  22.   else
  23.     set doc = 0 -- dispose of old one if there
  24.     
  25.     -- HEAD OFF MISSING xTRA if needed
  26.     set XtraList = []
  27.     repeat with counter = 1 to (the number of xtras)
  28.       append xtralist, the name of xtra counter
  29.     end repeat
  30.     
  31.     if string(XtraList) contains "PrintOMatic_Lite" then nothing
  32.     else 
  33.       case the machinetype of
  34.           
  35.         256: -- PC error msg
  36.           alert "Please ensure that the files ''POMLITE.X16'' and ''POMLITE.X32'' are in the folder called ''PMCD\XTRAS\''. You will have to 1). quit the Prime Ministers application, 2). make sure ''POMLITE.X16'' and ''POMLITE.X32'' are in the folder called ''PMCD\XTRAS\'' and then 3). Double-click the Prime Ministers Icon. Then you will be able to try printing. If this doesn't work, try removing, then re-installing the Prime Ministers application."
  37.           
  38.         otherwise: -- Mac error msg
  39.           alert "Please ensure that the file ''PrintOMatic Lite'' is in the folder called ''Xtras,'' which is in the foler containing the ''Launch PMs'' icon. You will have to 1). quit the Prime Ministers application, 2). make sure ''PrintOMatic Lite'' is in the folder called ''Xtras,'' and then 3). Double-click the ''Launch PMs'' icon. Then you will be able to try printing. If this doesn't work, try removing, then re-installing the Prime Ministers application."
  40.           
  41.       end  case
  42.     end if
  43.     set doc = new(xtra "PrintOMatic_Lite")
  44.     
  45.     -- validate printer
  46.     if not objectP(doc) then
  47.       beep
  48.       alert "Sorry, no printer is available." 
  49.       exit
  50.     end if
  51.     
  52.     -- boilerplate
  53.     
  54.     set copyRightNotice = ¼
  55. "____________________________________" & return ¼
  56. & "from the Prime Ministers of Canada CD-ROM" & return¼
  57. & "Copyright ⌐1996, 1997 ExCITE, Simon Fraser University"
  58.     
  59.     set pmStatsDB = [1: [#pmname: "Sir John A Macdonald", #pmparty: "Conservative", #pmtermtag: "Terms", #pmterms: ["1 July 1867 - 5 Nov 1873", "17 Oct 1878 - 6 June 1891"]], 2: [#pmname: "Alexander Mackenzie", #pmparty: "Liberal", #pmtermtag: "Term", #pmterms: ["7 Nov 1873 - 9 Oct 1878"]], 3: [#pmname: "Sir John J.C. Abbott", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["16 June 1891 - 24 Nov 1892"]], 4: [#pmname: "Sir John Sparrow Thompson", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["5 Dec 1892 - 12 Dec 1894"]], 5: [#pmname: "Sir Mackenzie Bowell", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["21 Dec 1894 - 27 April 1896"]], 6: [#pmname: "Sir Charles Tupper", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["1 May 1896 - 8 July 1896"]], 7: [#pmname: "Sir Wilfrid Laurier", #pmparty: "Liberal", #pmtermtag: "Term", #pmterms: ["11 July 1896 - 6 Oct 1911"]], 8: [#pmname: "Sir Robert Laird Borden", #pmparty: "Conservative, Unionist", #pmtermtag: "Term", #pmterms: ["10 Oct 1911 - 10 July 1920"]], 9: [#pmname: "Arthur Meighen", #pmparty: "Conservative", #pmtermtag: "Terms", #pmterms: ["10 July 1920 - 29 Dec 1921", "29 June 1926 - 25 Sept 1926"]], 10: [#pmname: "William Lyon Mackenzie King", #pmparty: "Liberal", #pmtermtag: "Terms", #pmterms: ["29 Dec 1921 - 28 June 1926", "25 Sept 1926 - 6 Aug 1930", "23 Oct 1935 - 15 Nov 1948"]], 11: [#pmname: "Richard Bedford Bennett", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["7 Aug 1930 - 23 Oct 1935"]], 12: [#pmname: "Louis St.Laurent", #pmparty: "Liberal", #pmtermtag: "Term ofOffice:", #pmterms: ["15 Nov 1948 - 21 June 1957"]], 13: [#pmname: "John George Diefenbaker", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["21 June 1957 - 22 April 1963"]], 14: [#pmname: "Lester Bowles Pearson", #pmparty: "Liberal", #pmtermtag: "Term", #pmterms: ["22 April 1963 - 20 April 1968"]], 15: [#pmname: "Pierre Elliott Trudeau", #pmparty: "Liberal", #pmtermtag: "Terms", #pmterms: ["20 April 1968 - 3 June 1979", "3 March 1980 - 30 June 1984"]], 16: [#pmname: "Charles Joseph Clark", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["4 June 1979 - 2 March 1980"]], 17: [#pmname: "John Napier Turner", #pmparty: "Liberal", #pmtermtag: "Term", #pmterms: ["30 June 1984 - 17 Sept 1984"]], 18: [#pmname: "Martin Brian Mulroney", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["17 Sept 1984 - 25 June 1993"]], 19: [#pmname: "Kim Campbell", #pmparty: "Conservative", #pmtermtag: "Term", #pmterms: ["25 June 1993 - 4 Nov 1993"]], 20: [#pmname: "Jean Chretien", #pmparty: "Liberal", #pmtermtag: "Term", #pmterms: ["4 Nov 1993 - Present"]]]
  60.     
  61.     -- get the stuff to print
  62.     set titleLine = ""
  63.     set printKnowledge = new(script"interface profiler parent")
  64.     derive printKnowledge
  65.     set theList = the membsToPrint of printKnowledge
  66.     
  67.     --NB DO NOT change textpop.dir without changing the sprite numbers in here
  68.     
  69.     global glossontop
  70.     if glossontop then
  71.       
  72.       --    (windowPresent("textpop.dir")): -- glossary popup is open
  73.       tell window("textpop.dir") to derive printKnowledge
  74.       -- store glossary term
  75.       tell window("textpop.dir") to put the text of the member of sprite 6 into theText
  76.       -- store glossary definition
  77.       tell window("textpop.dir") to put return & return & the text of the member of sprite 2 after theText
  78.       
  79.     else
  80.       if enablePrintPictures = TRUE then
  81.         if the type of (getat(theList, 1)) = #bitmap then 
  82.           put getat(theList, 1) into printPicture
  83.           -- check in list of (dis)allowed picture cast members here ?
  84.         end if
  85.       end if
  86.       
  87.       case the type of (getat(theList, count(theList))) of
  88.         #richText, #field:
  89.           put the text of (getat(theList, count(theList))) into theText
  90.           put line 1 of theText into titleLine
  91.           delete line 1 of theText
  92.       end case
  93.       
  94.       case the type of (getat(theList, count(theList))) of
  95.         #richText, #field:
  96.           put the text of (getat(theList, count(theList))) into theText
  97.           put line 1 of theText into titleLine
  98.           delete line 1 of theText
  99.       end case
  100.       
  101.     end if
  102.     
  103.     --      case true of
  104.     --        (the width of printPicture > 600): setLandscapeMode doc, TRUE
  105.     --        otherwise: setLandscapeMode doc, FALSE
  106.     --      end case
  107.     
  108.     -- headline & space
  109.     setTextSize doc, 14
  110.     setTextStyle doc, "Bold"
  111.     append doc, "Profile: "
  112.     setTextStyle doc, "Normal"
  113.     
  114.     -- ID for Prime Minister here
  115.     set pmIDrec = getat(pmStatsDB, current_pm)
  116.     
  117.     -- name & party
  118.     set pmNameStr = the pmname of pmIDrec && "(" & the pmparty of pmIDrec & ")" & return
  119.     append doc, pmNameStr
  120.     
  121.     -- years in office
  122.     repeat with theTerm in the pmterms of pmIDrec
  123.       set theYearsStr = theYearsStr & theTerm 
  124.       if length(the last line of theYearsStr) > 45 then put return after theYearsStr
  125.       else put "    " after theYearsStr
  126.     end repeat
  127.     
  128.     set theTermsStr = the pmtermtag of pmIDrec && "in Office:" && theYearsStr
  129.     setTextSize doc, 12
  130.     setTextStyle doc, "Italic"
  131.     append doc theTermsStr & return & return
  132.     
  133.     -- picture & space
  134.     if not voidP(printPicture) then
  135.       append doc, printPicture     
  136.       append doc return
  137.     end if
  138.     
  139.     -- body
  140.     setTextStyle doc, "Normal"
  141.     
  142.     -- title line or photo credit
  143.     if titleLine <> EMPTY then append doc, titleLine & return
  144.     
  145.     append doc, theText
  146.     
  147.     -- space & footer
  148.     setTextSize doc, 9
  149.     setTextStyle doc, "Italic"
  150.     append doc, return & copyRightNotice  
  151.     
  152.     -- go
  153.     --    if doJobSetup (doc) = TRUE then print doc -- inserts a print setup dialogue box.
  154.     -- until the palette issue is resolved, don't show a dialogue box.
  155.     print doc
  156.     --    put theText
  157.     -- free up memory
  158.     set doc = 0
  159.   end if
  160.   
  161.   updatestage
  162.   set the cursor of sprite the clickon to [member "hand", member "hand mask"]
  163.   
  164.   --  if the colordepth > 8 then puppettransition 51, 02, 16
  165.   --  go to backframe
  166. end
  167.